package com.cxs.plan.mapper;

import com.cxs.plan.VO.PayVO;
import com.cxs.plan.domain.entity.PayCard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

/**
* @author Administrator
* @description 针对表【pay_card(支付卡包)】的数据库操作Mapper
* @createDate 2024-04-02 16:57:25
* @Entity com.cxs.plan.domain.entity.PayCard
*/
public interface PayCardMapper extends BaseMapper<PayCard> {

    @Select("select money from pay_card where id = #{cardId}")
    BigDecimal selectBalanceByCardId(Integer cardId);

    @Update("update pay_card set money = #{balance} where id = #{cardId}")
    void updateMoneyByCardId(@Param("cardId") Integer cardId, @Param("balance") BigDecimal balance);

    Object selectPayCardDetail(Integer id);

    List<PayVO> selectPayCardRecord(@Param("cardId") Integer id);
}




